Fix bug in list_file_walk when cwd != path
authorMatt Brubeck <mbrubeck@limpet.net>
Thu, 11 Sep 2014 19:00:11 +0000 (12:00 -0700)
committerMatt Brubeck <mbrubeck@limpet.net>
Fri, 12 Sep 2014 17:21:38 +0000 (10:21 -0700)
Previously this was calling .is_file() on a relative path.  This would fail if
the path was not relative to the current working directory, for example when
fingerprinting a path dependency.

src/cargo/sources/path.rs

index f340a36f16ecbaf02b60aec0e761dce06ae9811c..7f7536b679f51f9ad39f41eef498782fd89a667f 100644 (file)
@@ -80,8 +80,8 @@ impl PathSource {
 
         let root = pkg.get_manifest_path().dir_path();
         Ok(candidates.move_iter().filter(|candidate| {
-            let candidate = candidate.path_relative_from(&root).unwrap();
-            !pats.iter().any(|p| p.matches_path(&candidate)) &&
+            let relative_path = candidate.path_relative_from(&root).unwrap();
+            !pats.iter().any(|p| p.matches_path(&relative_path)) &&
                 candidate.is_file()
         }).collect())
     }